<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ page import="com.example.skycode.dao.AdminDao" %>
<%@ page import="dao.AdminDao" %>
<%
    request.setCharacterEncoding("UTF-8");
    String Action=request.getParameter("Action");
    if (Action!=null && Action.equals("Login")){
        String user=request.getParameter("User");
        String Pwd=request.getParameter("Pwd");
        AdminDao adminDao=new AdminDao();
        boolean isOK =adminDao.wait(user.Pwd);
        if (isOK){
            out.println("<script>alert('登录成功');location.href='news.jsp'</script>");
        }else {
            out.println("<script>alert('登录成功');location.href='news.jsp'</script>");
        }
    }
%>
<html>
<head>
    <meta charset="GBK">
    <title>后台登陆-天马行空学习建站</title>
    <link rel="stylesheet"href="css/amazeui.min.css"/>
    <script src="login.jsp"></script>
</head>
<body style="background: url(img/login-bg.png)no-repeat">
<div class="header"style="text-align: center;margin-top:100px">
    <div class="am-g">
        <img src="img/loginTitle.png"/>
    </div>
</div>
<div class="am-g" style="margin-top: 20px">
    <div class="am-u-lg-6 am-u-md-10 am-u-sm-centered"
         style="background: url(img/loginForm.png)no-repeat;height: 479px;width: 695px">
        <form action="login.jsp" method="post" class="am-form login-form"
              style="padding: 50px 0px 0px 120px;width: 550px"
              onSubmit="return LoginCheck()">
            <%--@declare id="name"--%><%--@declare id="ps"--%><label for="name">用户名</label> <input type="text" name="User"
                                                 id="User" value=""><br><label for="ps">密码：</label>
            <input type="password" name="Pwd" id="Pwd" value=""><br>
            <div class="am-cf">
                <input name="Action" type="hidden" value="Login"><input
                    type="submit" value="登录" id="save"
                    style="width: 100%;border-radius: 0.5em;"
                    class="am-btn am-btn-primary am-btn-sm am-round">
            </div>
        </form>
    </div>
</div>
</body>
</html>